import { items } from '@/config/menu'
import { Menu } from 'antd'
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import styles from './index.module.less'

export default function View() {
  const [selectedKeys] = useState<string[]>([])

  const navigate = useNavigate()

  const handleClickMenu = ({ key }: { key: string }) => {
    navigate(key)
  }

  return (
    <div className='view-wrapper'>
      <Menu
        className={styles.menu}
        defaultSelectedKeys={['1']}
        theme='dark'
        items={items}
        selectedKeys={selectedKeys}
        onClick={handleClickMenu}
      />
    </div>
  )
}
